package com.eksframework.commons.core.tuple;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * TupleFour
 *
 * @author: chenfenghai
 * @version: 1.0
 * @date: 2020-12-23 9:43
 */
@Data
@EqualsAndHashCode
@ToString
public class TupleFour<A, B, C, D> {

    /**
     * 元组1
     */
    private A first;

    /**
     * 元组2
     */
    private B second;

    /**
     * 元组3
     */
    private C third;

    /**
     * 元组4
     */
    private D fourth;

    /**
     * 私有构造
     */
    private TupleFour() {
    }

    /**
     * 私有构造
     *
     * @param first  元组1
     * @param second 元组2
     * @param third  元组3
     * @param fourth 元组4
     */
    private TupleFour(A first, B second, C third, D fourth) {
        this.first = first;
        this.second = second;
        this.third = third;
        this.fourth = fourth;
    }

    /**
     * 实例化对象
     *
     * @param <A> 元组1类型
     * @param <B> 元组2类型
     * @param <C> 元组3类型
     * @param <D> 元组4类型
     * @return 元组实例
     */
    public static <A, B, C, D> TupleFour<A, B, C, D> of() {
        return new TupleFour<>();
    }

    /**
     * 实例化对象
     *
     * @param first  元组1
     * @param second 元组2
     * @param third  元组3
     * @param fourth 元组4
     * @param <A>    元组1类型
     * @param <B>    元组2类型
     * @param <C>    元组3类型
     * @param <D>    元组4类型
     * @return 元组实例
     */
    public static <A, B, C, D> TupleFour<A, B, C, D> of(A first, B second, C third, D fourth) {
        return new TupleFour<>(first, second, third, fourth);
    }
}
